package com.link2room.rodimus.entity;

import com.link2room.common.entity.BaseEntity;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Created by LN on 2017/10/25
 */
@Entity
@Table(name = "coupon_schedule")
public class CouponScheduleEntity extends BaseEntity{
    /**
     * 发放场合
     */
    private String occasion;
    /**
     * 电子券
     */
    private String couponCode;

    /**
     * 发放张数
     * @return
     */
    private Integer num;
    @Basic
    @Column(name = "occasion")
    public String getOccasion() {
        return occasion;
    }

    public void setOccasion(String occasion) {
        this.occasion = occasion;
    }

    @Basic
    @Column(name = "coupon_code")
    public String getCouponCode() {
        return couponCode;
    }

    public void setCouponCode(String couponCode) {
        this.couponCode = couponCode;
    }

    @Basic
    @Column(name = "num")
    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        CouponScheduleEntity that = (CouponScheduleEntity) o;

        if (occasion != null ? !occasion.equals(that.occasion) : that.occasion != null) return false;
        if (couponCode != null ? !couponCode.equals(that.couponCode) : that.couponCode != null) return false;
        return num != null ? num.equals(that.num) : that.num == null;
    }

    @Override
    public int hashCode() {
        int result = occasion != null ? occasion.hashCode() : 0;
        result = 31 * result + (couponCode != null ? couponCode.hashCode() : 0);
        result = 31 * result + (num != null ? num.hashCode() : 0);
        return result;
    }
}
